
<!--#begin topcatcreate -->
<script type="text/javascript" language="JavaScript1.5">
//<![CDATA[

function bab_onImageSelected()
{
	oOldInput = $('categoryPicture');
	if(oOldInput && oOldInput.value.length > 0)
	{
		oOldInput.setStyle({visibility:'hidden'});
		oOldInput.writeAttribute({id:''});
		
		var oNewInput = new Element('input', { type: 'file', id: 'categoryPicture', name: 'categoryPicture' })
		
		oOldInput.parentNode.replaceChild(oNewInput, oOldInput);

		$('hiddenFrom').appendChild(oOldInput);

		$(oNewInput).observe('change', bab_onImageSelected);
		
		$('hiddenFrom').submit();
		
		bab_disableForm();
	}
}

function bab_onDeletePicture(oEvent)
{
	Event.stop(oEvent);

	var sImage = $('topCatCreate').sTempImgName.value;
	$('topCatCreate').sTempImgName.value = '';
	$('topCatCreate').sImgName.value = '';

	var sUrl = '{ babUrlScript }?tg=topcats&idx=deleteTempImage&sImage=' + sImage + '&t=' + (new Date()).getTime();
	new Ajax.Request(sUrl, 
		{
			method: "get",
			onComplete: onDeleteImageResponse
		}
	);

	bab_disableForm();
}

function onDeleteImageResponse()
{
	$('tempImg').src = '#';
	bab_hide('imagePreviewTR');
	bab_hide('messageTR');
	bab_enableForm();
}

function bab_onLoadImagePreview()
{
	if(this.src != '#')
	{
		bab_show('imagePreviewTR');
	}
}

function uploadDone()
{
	var sBodyContent = frames['hiddenIFrame'].document.getElementsByTagName("body")[0].innerHTML;

	if(sBodyContent.length != 0)
	{
		var sJSon = eval("(" + sBodyContent + ")"); //Parse JSON
		
		if(sJSon.success) 
		{ //This part happens when the image gets uploaded.
	
			var aImg = sJSon.sMessage.split(',');
			
			var sOldImage = $('topCatCreate').sTempImgName.value;
			$('topCatCreate').sTempImgName.value = aImg[0];
			$('topCatCreate').sImgName.value = aImg[1];
	
			$('tempImg').src = "{ babUrlScript }?tg=topcats&idx=getImage&iWidth=120&iHeight=90&sImage=" + aImg[0] + '&sOldImage=' + sOldImage;
			
			bab_hide('messageTR');
		}
		else if(sJSon.failure) 
		{ //Upload failed - show user the reason.
			bab_displayMessage(sJSon.sMessage);
		}	
	}
	
	bab_enableForm();
}

function bab_getHiddenUpload()
{
	var sUrl = '{ babUrlScript }?tg=topcats&idx=getHiddenUpload&t=' + (new Date()).getTime();
	new Ajax.Request(sUrl, 
		{
			method: "get",
			onSuccess: onHiddenUploadResponse
		}
	);
}

function onHiddenUploadResponse(oTransport)
{
	try
	{
		$($('topCatCreate').parentNode).insert({'bottom' : oTransport.responseText});
		bab_enableForm();
	}
	catch(e)
	{
		bab_displayMessage(e.message);
	}
}

function bab_displayMessage(message)
{
	if(bab_show('messageTR'))
	{
		$('statusLine').update(message);
	}
}

function bab_show(sIdElement)
{
	if($(sIdElement))
	{
		$(sIdElement).show();
		return true;
	}
	return false;
}

function bab_hide(sIdElement)
{
	if($(sIdElement))
	{
		$(sIdElement).hide();
		return true;
	}
	return false;
}

function bab_disableForm()
{
	$('mainFormSubmit').setAttribute('disabled', 'disabled');
	if($('categoryPicture'))
	{
		$('categoryPicture').setAttribute('disabled', 'disabled');
	}
	$('deletePicture').hide();
}

function bab_enableForm()
{
	$('mainFormSubmit').removeAttribute('disabled');
	if($('categoryPicture'))
	{
		$('categoryPicture').removeAttribute('disabled');
	}
	$('deletePicture').show();
}

//]]>
</script>

<form method="post" id="topCatCreate" name="topCatCreate" enctype="multipart/form-data" action="{ babPhpSelf }">
	<input type="hidden" name="MAX_FILE_SIZE" value="{ iMaxImgFileSize }" />
	<input type="hidden" name="tg" value="topcats" />
	<input type="hidden" name="idx" value="List" />
	<input type="hidden" name="add" value="add" />
	<input type="hidden" name="sTempImgName" value="{ sTempImgName }" />
	<input type="hidden" name="sImgName" value="{ sImgName }" />
	
	<table width="50%" border="0" cellspacing="0" cellpadding="2" align="center">
		<tr> 
			<td class="BabLoginCadreBackground"> 
				<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
					<tr> 
						<td width="30%" align="right">{ sNameCaption }:</td>
						<td width="70%"> 
							<input type="text" name="name" size="20" maxlength="60" value="{ sName }" />
						</td>
					</tr>
					<tr> 
						<td align="right">{ sDescriptionCaption }:</td>
						<td> 
							<input type="text" name="description" size="45" maxlength="200" value="{ sDescription }" />
						</td>
					</tr>
					<tr> 
						<td align="right">{ enabled }:</td>
						<td> 
							<select name="benabled">
								<!--#in getNextPrivateSectionInfo -->
								<option value="{ sPrivSecValue }" { sSelectedPrivSec }>{ sPrivSecCaption }</option>
								<!--#endin getNextPrivateSectionInfo -->
							</select>
						</td>
					</tr>
					<tr> 
						<td align="right">{ templatetxt }:</td>
						<td> 
							<select name="template">
								<!--#in getnexttemplate -->
								<option value="{ templateid }" { sSelectedTmpl }>{ templateval }</option>
								<!--#endin getnexttemplate -->
							</select>
						</td>
					</tr>
					<tr> 
						<td align="right">{ disptmpltxt }:</td>
						<td> 
							<select name="disptmpl">
								<!--#in getnextdisptemplate -->
								<option value="{ templateid }" { sSelectedDispTmpl }>{ templateval }</option>
								<!--#endin getnextdisptemplate -->
							</select>
						</td>
					</tr>
					<!--#if topcatscount -->
					<tr> 
						<td align="right">{ topcattxt }:</td>
						<td> 
							<select name="topcatid">
								<!--#in getnexttopcat -->
								<option value="{ topcatid }" { selected }>{ topcatval }</option>
								<!--#endin getnexttopcat -->
							</select>
						</td>
					</tr>
					<!--#endif topcatscount -->
					<!--#if bImageUploadEnable  -->
					<tr> 
						<td align="right">{ sSelectImageCaption }</td>
						<td>
							<input type="file" id="categoryPicture" name="categoryPicture" />
						</td>
					</tr>
					<tr id="messageTR" style="display:none"> 
						<td colspan="2">
							<div id="statusLine">
							</div>
						</td>
					</tr>
					<tr id="imagePreviewTR" style="display:none"> 
						<td align="right">{ sImagePreviewCaption }</td>
						<td>
							<img id="tempImg" border="0" src="#" alt="{ sAltImagePreview }" />
							<input type="image" id="deletePicture" src="{ babInstallPath }skins/ovidentia/images/22x22/stop.png" />
						</td>
					</tr>
					<!--#else bImageUploadEnable -->
					<tr>
						<td colspan="2">
							<div class="error">
								{ sDisabledUploadReason }
							</div>
						</td>
					</tr>
					<!--#endif bImageUploadEnable -->
					<tr> 
						<td colspan="2" align="center"> 
							<input type="submit" id="mainFormSubmit" name="submit" value="{ add }" />
							<br />
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
<br />

<script type="text/javascript" language="JavaScript1.5">
//<![CDATA[
if('undefined' != typeof document.observe)
{
	document.observe("dom:loaded", function bab_init() {
		bab_getHiddenUpload();
		
		bab_disableForm();
		
		if($('categoryPicture'))
		{
			$('categoryPicture').observe('change', bab_onImageSelected);
		}
		
		if($('deletePicture'))
		{
			$('deletePicture').observe('click', bab_onDeletePicture);
		}
		
		if($('tempImg'))
		{
			$('tempImg').observe('load', bab_onLoadImagePreview);
			
			var sTempImgName = $('topCatCreate').sTempImgName.value;
			var sImgName = $('topCatCreate').sImgName.value;
			
			if(sTempImgName.length > 0 && sImgName.length > 0)
			{
				$('tempImg').src = "{ babUrlScript }?tg=topcats&idx=getImage&iWidth=120&iHeight=90&sImage=" + sTempImgName;
			}
		}
	});
}
//]]>
</script>
<!--#end topcatcreate -->



<!--#begin topcatslist -->
<!--#if countparents -->
<br />
<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr> 
<td class="BabLoginCadreBackground" align="center" valign="middle"> 
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr valign="middle"> 
<td class="BabSiteAdminFontBackground">
<!--#in getnextcat --> 
&nbsp;
<!--#if burl -->
<a class="BabSiteAdminListLink" href="{ parenturl }">{ parentval }</a>
<!--#else burl -->
&nbsp;{ parentval }
<!--#endif burl -->
&nbsp;/&nbsp;
<!--#endin getnextcat --> 
</td></tr>
</table>
</td></tr>
</table>
<br />
<!--#endif countparents -->
<form method="post" action="{ babPhpSelf }" name="listform">
<input type="hidden" name="tg" value="topcats">
<input type="hidden" name="idx" value="List">
<input type="hidden" name="idp" value="{ idp }">
<input type="hidden" name="update" value="disable">
<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr> 
<td class="BabLoginCadreBackground" align="center" valign="middle"> 

<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr valign="middle"> 
<td class="BabSiteAdminTitleFontBackground">{ name } </td>
<td class="BabSiteAdminTitleFontBackground">{ description } </td>
<td align="center" class="BabSiteAdminTitleFontBackground">{ topcats } </td>
<td align="center" class="BabSiteAdminTitleFontBackground">{ topics } </td>
<td width="1%" align="center" class="BabSiteAdminTitleFontBackground">{ disabled }</td>
</tr>

<!--#in getnext --> 
<!--#if altbg --><tr valign="middle" class="BabSiteAdminFontBackground"><!--#else altbg --><tr valign="middle" class="BabForumBackground1"><!--#endif altbg --><td><a class="BabSiteAdminListLink" href="{ url }">{ arr[title] }</a></td>
<td>{ arr[description] }</td>
<td align="center"><a class="BabSiteAdminListLink" href="{ topcatcounturl }">{ topcatcount }</a></td>
<td align="center"><a class="BabSiteAdminListLink" href="{ topcounturl }">{ topcount }</a></td>
<td width="0%" align="center"> 
<input type="checkbox" name="topcats[]" { catchecked } value="{ arr[id] }">
</td>
</tr>
<!--#endin getnext -->
<tr> 
<td class="BabSiteAdminTitleFontBackground" nowrap 
valign="middle"><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="1" height="1" border="0"></td>
<td class="BabSiteAdminTitleFontBackground" 
valign="middle"><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="1" height="1" border="0"></td>
<td class="BabSiteAdminTitleFontBackground" 
valign="middle"><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="1" height="1" border="0"></td>
<td class="BabSiteAdminTitleFontBackground" 
valign="middle"><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="1" height="1" border="0"></td>
<td width="1%" align="center" valign="middle" class="BabSiteAdminTitleFontBackground"><a href="javascript:onCheckAll('topcats', true)"><img src="{ babSkinPath }images/Puces/Pucecheked.gif" alt="{ checkall }" width="10" height="10" border="0"></a><a href="javascript:onCheckAll('topcats', false)"><img src="{ babSkinPath }images/Puces/PuceUncheked.gif" alt="{ uncheckall }" width="10" height="10" border="0"></a></td>
</tr>
</table>

</td></tr></table>
<br />
<div align="center">
<input type="submit" name="submit" value="{ update }"></div>
<br />
</form>
<!--#end topcatslist -->




<!--#begin topcatmodify -->
<script type="text/javascript" language="JavaScript1.5">
//<![CDATA[

function bab_onImageSelected()
{
	oOldInput = $('categoryPicture');
	if(oOldInput && oOldInput.value.length > 0)
	{
		oOldInput.setStyle({visibility:'hidden'});
		oOldInput.writeAttribute({id:''});
		
		var oNewInput = new Element('input', { type: 'file', id: 'categoryPicture', name: 'categoryPicture' })
		
		oOldInput.parentNode.replaceChild(oNewInput, oOldInput);

		$('hiddenFrom').appendChild(oOldInput);

		$(oNewInput).observe('change', bab_onImageSelected);
		
		$('hiddenFrom').submit();
		
		bab_disableForm();
	}
}

function bab_onDeletePicture(oEvent)
{
	Event.stop(oEvent);

	var sImage = $('topCatModify').sTempImgName.value;
	$('topCatModify').sTempImgName.value = '';
	$('topCatModify').sImgName.value = '';

	var sUrl = '{ babUrlScript }?tg=topcats&idx=deleteTempImage&sImage=' + sImage + '&t=' + (new Date()).getTime();
	new Ajax.Request(sUrl, 
		{
			method: "get",
			onComplete: onDeleteImageResponse
		}
	);

	bab_disableForm();
}

function onDeleteImageResponse()
{
	$('tempImg').src = '#';
	bab_hide('imagePreviewTR');
	bab_hide('messageTR');
	bab_enableForm();
}

function bab_onLoadImagePreview()
{
	if(this.src != '#')
	{
		bab_show('imagePreviewTR');
	}
	bab_enableForm();
}

function uploadDone()
{
	var sBodyContent = frames['hiddenIFrame'].document.getElementsByTagName("body")[0].innerHTML;

	if(sBodyContent.length != 0)
	{
		var sJSon = eval("(" + sBodyContent + ")"); //Parse JSON
		
		if(sJSon.success) 
		{ //This part happens when the image gets uploaded.
	
			var aImg = sJSon.sMessage.split(',');
			
			var sOldImage = $('topCatModify').sTempImgName.value;
			$('topCatModify').sTempImgName.value = aImg[0];
			$('topCatModify').sImgName.value = aImg[1];
	
			$('tempImg').src = "{ babUrlScript }?tg=topcat&idx=getImage&iWidth=120&iHeight=90&sImage=" + aImg[0] + '&sOldImage=' + sOldImage;
			
			bab_hide('messageTR');
		}
		else if(sJSon.failure) 
		{ //Upload failed - show user the reason.
			bab_displayMessage(sJSon.sMessage);
		}	
	}
	
	bab_enableForm();
}

function bab_getHiddenUpload()
{
	var sUrl = '{ babUrlScript }?tg=topcat&idx=getHiddenUpload&iIdCategory=' + { arr[id] };
	new Ajax.Request(sUrl, 
		{
			method: "get",
			onSuccess: onHiddenUploadResponse
		}
	);
}


function onHiddenUploadResponse(oTransport)
{
	try
	{
		$($('topCatModify').parentNode).insert({'bottom' : oTransport.responseText});
	}
	catch(e)
	{
		bab_displayMessage(e.message);
	}
}

function bab_displayMessage(message)
{
	if(bab_show('messageTR'))
	{
		$('statusLine').update(message);
	}
}

function bab_show(sIdElement)
{
	if($(sIdElement))
	{
		$(sIdElement).show();
		return true;
	}
	return false;
}

function bab_hide(sIdElement)
{
	if($(sIdElement))
	{
		$(sIdElement).hide();
		return true;
	}
	return false;
}

function bab_disableForm()
{
	$('mainModifySubmit').setAttribute('disabled', 'disabled');
	
	if($('mainDeleteSubmit'))
	{
		$('mainDeleteSubmit').setAttribute('disabled', 'disabled');
	}
	
	$('deletePicture').hide();
		
	if($('categoryPicture'))
	{
		$('categoryPicture').setAttribute('disabled', 'disabled');
	}
}

function bab_enableForm()
{
	$('mainModifySubmit').removeAttribute('disabled');
	
	if($('mainDeleteSubmit'))
	{
		$('mainDeleteSubmit').removeAttribute('disabled');
	}
	
	$('deletePicture').show();
	
	if($('categoryPicture'))
	{
		$('categoryPicture').removeAttribute('disabled');
	}
}

function bab_createImagePreviewTR()
{
	var oTr = new Element('tr', {id:'imagePreviewTR'});
	$(oTr).setStyle({display:'none'});
	
	var oTd1 = new Element('td', {align:'right'});
	$(oTd1).update("{ sImagePreviewCaption }");
	
	var oTd2 = new Element('td');
	
	var oImg = new Element('img', {id:'tempImg', src:'{ sImageUrl }', alt:"{ sAltImagePreview }"});
	
	var oInput = new Element('input', { type:'image', id:'deletePicture', src:'{ babInstallPath }skins/ovidentia/images/22x22/stop.png'});
	$(oInput).setStyle({display:'none'});
	
	oTd2.appendChild(oImg);
	oTd2.appendChild(oInput);
	oTr.appendChild(oTd1);
	oTr.appendChild(oTd2);
	
	$('messageTR').parentNode.insertBefore(oTr, $('messageTR'));
}

/* Hide the list of parent category because javascript is activated and there is a better method
   to select the parent category */
function ovidentia_hideselectparentcategory() {
	document.getElementById('ovidentia_listparentcategories').style.display = 'none';
	document.getElementById('ovidentia_ancientfield_topcatid').name = 'ancienttopcatid';
	document.getElementById('ovidentia_listparentcategories_bettermethod').style.display = 'block';
	document.getElementById('ovidentia_field_topcatid').name = 'topcatid';
}

/* Open the tree view popup of categories for choose the parent category : method used only if javascript is activated */
function ovidentia_popuptreeviewselectparentcategory() {
	bab_dialog.selectarticle (
		function(selectedTopic) {
			document.getElementById('ovidentia_field_topcatid').value = selectedTopic['id'];
			document.getElementById('ovidentia_field_topcatname').innerHTML = selectedTopic['content'];
		}, 'show_categories=1&selectable_categories=1&ignored_categories={ idcategory }&hide_delegations=1'
	);
}

//]]>
</script>


<form method="post" id="topCatModify" name="topCatModify" enctype="multipart/form-data" action="{ babPhpSelf }">
	<input type="hidden" name="MAX_FILE_SIZE" value="{ iMaxImgFileSize }" />
	<input type="hidden" name="tg" value="topcat" />
	<input type="hidden" name="idx" value="Modify" />
	<input type="hidden" name="item" value="{ arr[id] }" />
	<input type="hidden" name="idp" value="{ arr[id_parent] }" />
	<input type="hidden" name="oldname" value="{ arr[title] }" />
	<input type="hidden" name="modify" value="modify" />
	<input type="hidden" name="sTempImgName" value="{ sTempImgName }" />
	<input type="hidden" name="sImgName" value="{ sImgName }" />
	
	<table  width="50%" border="0" cellspacing="0" cellpadding="2" align="center">
		<tr> 
			<td class="BabLoginCadreBackground" align="center" valign="middle"> 
				<table class="BabLoginMenuBackground"  width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
					<tr> 
						<td width="30%" align="right">{ name }:</td>
						<td width="70%"> 
							<input type="text" name="title" size="20" maxlength="60" value="{ arr[title] }" />
						</td>
					</tr>
					<tr> 
						<td align="right">{ description }:</td>
						<td> 
							<input type="text" name="description" size="30" maxlength="200" value="{ arr[description] }" />
						</td>
					</tr>
					<tr> 
						<td align="right">{ enabled }</td>
						<td> 
							<select name="benabled">
								<option value="N" { noselected }>{ no }</option>
								<option value="Y" { yesselected }>{ yes }</option>
							</select>
						</td>
					</tr>
					<tr> 
						<td align="right">{ templatetxt }</td>
						<td> 
							<select name="template">
								<option value=""></option>
								<!--#in getnexttemplate -->
								<option value="{ templateid }" { tmplselected }>{ templateval }</option>
								<!--#endin getnexttemplate -->
							</select>
						</td>
					</tr>
					<tr> 
						<td align="right">{ disptmpltxt }:</td>
						<td> 
							<select name="disptmpl">
								<!--#in getnextdisptemplate -->
								<option value="{ templateid }" { tmplselected }>{ templateval }</option>
								<!--#endin getnextdisptemplate -->
							</select>
						</td>
					</tr>
					<tr> 
						<td align="right">{ topcattxt }:</td>
						<td> 
							<div id="ovidentia_listparentcategories">
								<select name="topcatid" id="ovidentia_ancientfield_topcatid">
									<!--#in getnexttopcat -->
									<option value="{ topcatid }" { tmplselected }>{ topcatval }</option>
									<!--#endin getnexttopcat -->
								</select>
							</div>
							<div id="ovidentia_listparentcategories_bettermethod" style="display: none">
								<input type="hidden" name="topcatid_2" value="{ idcurrentparentcategory }" id="ovidentia_field_topcatid">
								<span id="ovidentia_field_topcatname">{ namecurrentparentcategory }</span>&nbsp;&nbsp;
								<a href="#" onclick="ovidentia_popuptreeviewselectparentcategory();return false;">
									<img title="" alt="" src="{ urlimgselectcategory }" class="icon"/>
								</a>
							</div>
						</td>
					</tr>
					
				<!--#if bImageUploadEnable  -->
					<tr> 
						<td align="right">{ sSelectImageCaption }</td>
						<td>
							<input type="file" id="categoryPicture" name="categoryPicture" />
						</td>
					</tr>
				<!--#else bImageUploadEnable -->
					<tr>
						<td colspan="2">
							<div class="error">
								{ sDisabledUploadReason }
							</div>
						</td>
					</tr>
				<!--#endif bImageUploadEnable -->
				
					<tr id="messageTR" style="display:none">
						<td colspan="2">
							<div id="statusLine">
							</div>
						</td>
					</tr>
					
				<!--#if bHaveAssociatedImage -->
					<tr id="deleteImageTR"> 
						<td align="right">{ sDeleteImageCaption }</td>
						<td>
							<input type="checkbox" name="deleteImageChk" { sDeleteImageChecked } value="1" />
						</td>
					</tr>
					<tr id="imagePreviewTR"> 
						<td align="right">{ sImagePreviewCaption }</td>
						<td>
							<img id="tempImg" border="0" src="{ sImageUrl }" alt="{ sAltImagePreview }" />
						</td>
					</tr>
				<!--#endif bHaveAssociatedImage -->

					<tr> 
						<td colspan="2" align="center"> 
							<input type="submit" name="submit" id="mainModifySubmit" value="{ modify }" />&nbsp;&nbsp;
							<!--#if bdelete -->
							<input type="submit" name="catdel" id="mainDeleteSubmit" value="{ delete }" />
							<!--#endif bdelete -->
							<br />
						</td>
					</tr>
					<!--#if bImageUploadEnable  -->
					<tr id="imageModifyInfoTR" style="display:none"> 
						<td colspan="2" align="center"> 
							<div class="info">
							{ sImageModifyMessage }
							</div>
						</td>
					</tr>
					<!--#endif bImageUploadEnable -->
				</table>
			</td>
		</tr>
	</table>
</form>
<br />

<script type="text/javascript" language="JavaScript1.5">
//<![CDATA[

bab_initFunctions.push(ovidentia_hideselectparentcategory());

if('undefined' != typeof document.observe)
{
	var bUploadPathValid = Boolean({ bUploadPathValid });
	
	if(bUploadPathValid)
	{
		document.observe("dom:loaded", function bab_init() {
		
			if($('imagePreviewTR'))
			{
				$('messageTR').parentNode.removeChild($('imagePreviewTR'));
			}
		
			if($('imageModifyInfoTR'))
			{
				$('imageModifyInfoTR').show();
			}
			
			if($('deleteImageTR'))
			{
				$('deleteImageTR').hide();
			}
			
			bab_createImagePreviewTR();
	
			bab_getHiddenUpload();
			
			var sTempImgName	= $('topCatModify').sTempImgName.value;
			var sImgName		= $('topCatModify').sImgName.value;
	
			bab_disableForm();
			
			if($('categoryPicture'))
			{
				$('categoryPicture').observe('change', bab_onImageSelected);
			}
			
			if($('deletePicture'))
			{
				$('deletePicture').observe('click', bab_onDeletePicture);
			}
			
			if($('tempImg'))
			{
				$('tempImg').observe('load', bab_onLoadImagePreview);
			}
	
			if(sImgName.length == 0)
			{
				bab_enableForm();
			}
		});
	}
}
//]]>
</script>
<!--#end topcatmodify -->


<br /><br /><br /><br />
<!--#begin topcatorder -->
<form method="post" name="ordform" action="{ babPhpSelf }">
<input type="hidden" name="tg" value="topcats">
<input type="hidden" name="idx" value="List">
<input type="hidden" name="idp" value="{ idp }">
<input type="hidden" name="update" value="order">

<table  width="50%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr> 
<td class="BabLoginCadreBackground" align="center" valign="middle"> 
<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr> 
<td valign="middle" align="center"> 
<select name="listtopcats[]" size=12 multiple>
  <option value="0">{ catname }</option>
  <!--#in getnext --> 
  <option value="{ topicid }">{ topicval }</option>
  <!--#endin getnext --> 
</select>
</td>
<td valign="middle" align="center"><a 
href="Javascript:move(true, document.ordform.elements[4])"><img src="{ babSkinPath }images/Puces/PuceGoTop.gif" 
width="22" height="18" border=0 alt="{ moveup }"></a> <br />
<br />
<a href="Javascript:move(false, document.ordform.elements[4])"> 
<img src="{ babSkinPath }images/Puces/PuceGoDown.gif" width="22" height="18" border=0 alt="{ movedown }"></a> 
<br /><br />
<a href="Javascript:sortList('sortAA', document.ordform.elements[4])">
<img src="{ babSkinPath }images/Puces/a-z.gif" border=0 alt="{ sorta }">
</a>
<br /><br />
<a href="Javascript:sortList('sortAD', document.ordform.elements[4])">
<img src="{ babSkinPath }images/Puces/z-a.gif" border=0 alt="{ sortd }">
</a>
</td>
</tr>
<tr> 
<td align="center"> 
<input type="submit" name="Submit" value="{ create }" 
onClick="selectAll(document.ordform.elements[4]); document.ordform.submit()">
<br />
<br />
</td>
<td>&nbsp; </td>
</tr>
</table>
</td>
</tr>
</table>
</form>

<!--#end topcatorder -->

<!--#begin howtousedefaultrights -->
<form method="post" action="{ babPhpSelf }" name="listform">
	<input type="hidden" name="tg" value="topcat" />
	<input type="hidden" name="idx" value="Modify" />
	<input type="hidden" name="item" value="{ item }" />
	<input type="hidden" name="action" value="updrights" />
	<table border="0" width="70%" cellpadding="2" cellspacing="0" align="center" class="BabLoginCadreBackground">
		<tr>
			<td> 
				<table class="BabLoginMenuBackground" border="0" width="100%" cellpadding="6" cellspacing="0">
					<tr>
						<td align="center">
							<p>{ t_with_selected } : </p>
						</td>
					</tr>
					<tr>
						<td>
							<p><input type="checkbox" name="opt[]" value="1" />{ t_topics }</p>
							<p><input type="checkbox" name="opt[]" value="2" />{ t_subcategories }</p>
							<p><input type="checkbox" name="opt[]" value="3" />{ t_topicssubcategories }</p>
							<p><input type="checkbox" name="opt[]" value="4" />{ t_all }</p>
						</td>
					</tr>
					<tr>
						<td align="center">
							<input type="submit" value="{ t_update }" />
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
<!--#end howtousedefaultrights -->
